<script setup>
const arr = [
  { title: '我是学生',
    to: '/pages/students/page1' },
  { title: '我是辅导员',
    to: '/pages/teachers/page1' },
  { title: '我是管理员',
    to: '/pages/leadership/page1' }
]

const toNext = (to) => {
  uni.redirectTo({ url: to })
  uni.switchTab({ url: to })
}
</script>

<template>
  <view class="page">
    <view class="container">
      <view
          class="item btn"
          v-for="(item, index) in arr"
          :key="index"
          @click="toNext(item.to)"
      >
        {{ item.title }}
      </view>
    </view>
  </view>
</template>

<style>
.page {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 20rpx;
  box-sizing: border-box;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14rpx;
  width: 360rpx;
  max-width: 90vw;
}


.item.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60rpx;
  padding: 0 14rpx;
  border: 2rpx solid #333;
  border-radius: 12rpx;
  background-color: #fff;
  color: #333;
  font-size: 50rpx;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color 0.2s, border-color 0.2s;
}


.item.btn:active {
  background-color: #f0f0f0;
  border-color: #555;
}
</style>